home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1985-09-02 | 10.0 KB | 195 lines |
- 10 '--------------------------------------------------------------------------
- 11 '|<UNK! {0009}>UASM-INT 1.12<UNK! {0009}><UNK! {0009}>22 Nov., 1983<UNK! {0009}><UNK! {0009}>White Crane Systems |
- 12 '|<UNK! {0009}>copyright 1983<UNK! {0009}><UNK! {0009}>Guy C. Gordon<UNK! {0009}><UNK! {0009}>3194 Friar Tuck Way |
- 13 '|<UNK! {0009}> <UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>Doraville, GA 30340 |
- 14 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}> |
- 16 '|<UNK! {0009}>This program takes the Unassemble output from UASM-JMP and puts in |
- 22 '|<UNK! {0009}>Macros for the DOS interrupts. The Macro calls and Symbols are |
- 24 '|<UNK! {0009}>contained in the companion file UASM-DOS.MAC, which contains a<UNK! {0009}> |
- 26 '|<UNK! {0009}>table of Equates which may be included in the final .ASM listing. |
- 27 '| <UNK! {0009}>If you modify the table to suit your needs or taste, make certain |
- 30 '|<UNK! {0009}>that it meets the requirements of both this program and your<UNK! {0009}> |
- 32 '|<UNK! {0009}>assembler.<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}> |
- 40 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}> |
- 46 '|<UNK! {0009}>Due to the large amount of disk I/O, this program will run fastest |
- 48 '|<UNK! {0009}>with the input and output files on a RAM drive. If you must put |
- 49 '|<UNK! {0009}>both files on floppies, specify separate drives for input & output. |
- 50 '********************************* NOTICE *********************************
- 51 '* USER SUPPORTED SOFTWARE (With thanks to Andrew Flugelman) *
- 52 '* *
- 53 '* A limited license is granted to all users of this program, to make *
- 54 '* copies of this program and distribute them to other users subject *
- 55 '* to the following conditions: *
- 56 '* 1. None of the notices or credits are to be bypassed, *
- 57 '* altered, or removed. *
- 58 '* 2. The program is not to be distributed in modified form. *
- 59 '* (Users are encouraged to distribute MERGE files.) *
- 60 '* 3. No fee is to be charged (or any other consideration *
- 61 '* received) for copying or distributing the program *
- 62 '* without an express written agreement with *
- 63 '* White Crane Systems. *
- 64 '**************************************************************************
- 70 CLS 'PRINT CHR$(27)+"E"; <UNK! {0009}>'CLS for IBM, ESC E for Victor 9000
- 71 PRINT " UASM-INT
- 72 PRINT " White Crane Systems Unassembler - Interrupt Module
- 73 PRINT "
- 74 PRINT " If you are using this program and finding it of value
- 75 PRINT " please send a cash contribution to support its upkeep and
- 76 PRINT " distribution. Use the UASM system of programs to unas-
- 77 PRINT " semble one average length .COM file, look over the results
- 78 PRINT " and calculate how many hours this would have taken you to
- 79 PRINT " to produce, multiply by the minimum wage, contribute that
- 80 PRINT " amount and use the programs free thereafter. If that's too
- 81 PRINT " much just send $20. Supporters will receive free notice
- 82 PRINT " of enhancements and updates.
- 83 PRINT " In any case you are encouraged to copy and distribute
- 84 PRINT " UASM to your friends provided you do so free of charge and
- 85 PRINT " in unmodified form.
- 87 PRINT "
- 88 PRINT " Guy C. Gordon
- 89 PRINT " White Crane Systems
- 90 PRINT " 3194 Friar Tuck Way
- 91 PRINT " Doraville, GA 30340
- 92 PRINT "
- 100 <UNK! {0009}>DEFINT A-Z: DIM SERVICE$(90), COMMENT$(90)<UNK! {0009}>'# DOS 2.00 services
- 110 <UNK! {0009}>TRUE=(1=1): FALSE=NOT TRUE
- 115 <UNK! {0009}>PRINT
- 120 <UNK! {0009}>INPUT "Enter name of input file [.JMP]: ", INFILE$
- 130 <UNK! {0009}> DR=INSTR(INFILE$,":"): EXT=INSTR(INFILE$,".")
- 140 <UNK! {0009}> IF EXT=0 THEN INFILE$=INFILE$+".JMP": EXT=INSTR(INFILE$,".")
- 145 <UNK! {0009}> ID$=MID$(INFILE$,DR+1,EXT-DR-1)
- 150 <UNK! {0009}>PRINT "Enter name of output file ["ID$".INT]: ";: INPUT "", OUTFILE$
- 160 <UNK! {0009}> IF INSTR(OUTFILE$,":")=LEN(OUTFILE$) THEN OUTFILE$=OUTFILE$+ID$
- 170 <UNK! {0009}> IF INSTR(OUTFILE$,".")=0 THEN OUTFILE$=OUTFILE$+".INT"
- 180 <UNK! {0009}>PRINT
- 190 <UNK! {0009}>GOSUB 1000<UNK! {0009}><UNK! {0009}><UNK! {0009}>'Read UASM-DOS.MAC file
- 400 '------------------------------------------------------------------------
- 401 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>READ SOURCE FILE<UNK! {0009}><UNK! {0009}><UNK! {0009}> |
- 402 '------------------------------------------------------------------------
- 405 <UNK! {0009}>PRINT TIME$,"Reading "INFILE$: PRINT ,"Writing "OUTFILE$: PRINT
- 410 <UNK! {0009}>OPEN INFILE$ FOR INPUT AS #1
- 420 <UNK! {0009}>OPEN OUTFILE$ FOR OUTPUT AS #2
- 422 <UNK! {0009}>LINE INPUT #1,A$: PRINT #2,A$: PRINT #2,<UNK! {0009}>'skip TITLE
- 425 <UNK! {0009}>PRINT #2,"INCLUDE<UNK! {0009}>UASM-DOS.MAC"
- 430 <UNK! {0009}>WHILE NOT EOF(1)
- 435 <UNK! {0009}> '<UNK! {0009}><UNK! {0009}><UNK! {0009}>Keep track of registers
- 440 <UNK! {0009}> LINE INPUT #1,A$
- 450 <UNK! {0009}> IF LEFT$(A$,1)="L" THEN AX$="": AH$="": AL$="": D$=""<UNK! {0009}> 'Entry point
- 460 <UNK! {0009}> IF MID$(A$,17,1)<>"A" THEN 500<UNK! {0009}>'Found defnition of A
- 470 <UNK! {0009}> IF MID$(A$,18,1)="X" THEN AX$=MID$(A$,20): AH$="": AL$="": GOTO 510
- 480 <UNK! {0009}> IF MID$(A$,18,1)="H" THEN AH$=MID$(A$,20): GOTO 510
- 490 <UNK! {0009}> IF MID$(A$,18,1)="L" THEN AL$=MID$(A$,20): GOTO 510
- 500 <UNK! {0009}> IF MID$(A$,17,2)="DX" OR MID$(A$,17,2)="DL" THEN D$=MID$(A$,20)
- 510 <UNK! {0009}> '<UNK! {0009}><UNK! {0009}><UNK! {0009}>Take care of INTerrupts
- 520 <UNK! {0009}> IF MID$(A$,9,3)="INT" THEN GOSUB 2000 ELSE PRINT #2, A$
- 580 <UNK! {0009}>WEND<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>'how can I get any work done
- 585 <UNK! {0009}>PRINT: PRINT TIME$,"UASM-INT Complete."<UNK! {0009}>'when you keep interrupting me?
- 590 <UNK! {0009}>CLOSE: END<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>
- 1000 '-------------------------------------------------------------------------
- 1001 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}>READ INTERRUPT 21 SERVICE CODES<UNK! {0009}><UNK! {0009}><UNK! {0009}> |
- 1002 '-------------------------------------------------------------------------
- 1005 <UNK! {0009}>PRINT TIME$,"Reading UASM-DOS.MAC"
- 1010 <UNK! {0009}>ON ERROR GOTO 1110
- 1020 <UNK! {0009}>OPEN "UASM-DOS.MAC" FOR INPUT AS #1
- 1030 <UNK! {0009}>WHILE LEFT$(A$,6)<>";START": LINE INPUT #1,A$: WEND
- 1040 <UNK! {0009}>ON ERROR GOTO 0
- 1050 <UNK! {0009}>WHILE NOT EOF(1):
- 1060 <UNK! {0009}> LINE INPUT #1,A$
- 1070 <UNK! {0009}> IF LEFT$(A$,4)=";END" THEN CLOSE: RETURN
- 1080 <UNK! {0009}> IF LEFT$(A$,1)=";" THEN 1100
- 1090 <UNK! {0009}><UNK! {0009}>SERV=VAL("&H"+MID$(A$,19,2)): SERVICE$(SERV)=LEFT$(A$,12)
- 1095 <UNK! {0009}><UNK! {0009}>COMMENT$(SERV)=MID$(A$,21): IF SERV>MAXSERV THEN MAXSERV=SERV
- 1100 <UNK! {0009}>WEND
- 1110 <UNK! {0009}>'<UNK! {0009}><UNK! {0009}><UNK! {0009}>locate UASM-DOS.MAC
- 1120 <UNK! {0009}>IF ERR<>53 THEN CLOSE: RETURN
- 1130 <UNK! {0009}>PRINT: PRINT "All right...."
- 1140 <UNK! {0009}>PRINT "Where have you put my data file? ";
- 1150 <UNK! {0009}>WHILE ANSWER$="": ANSWER$=INKEY$: WEND: PRINT ANSWER$":UASM-DOS.MAC"
- 1155 <UNK! {0009}>PRINT
- 1160 <UNK! {0009}>OPEN ANSWER$+":uasm-dos.mac" FOR INPUT AS #1
- 1180 <UNK! {0009}>RESUME NEXT
- 2000 '-------------------------------------------------------------------------
- 2001 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>INTERRUPT<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}> |
- 2002 '-------------------------------------------------------------------------
- 2010 <UNK! {0009}>INTERRUPT=VAL("&H"+MID$(A$,17,2))
- 2020 <UNK! {0009}>IF INTERRUPT=&H21 THEN 2100
- 2030 <UNK! {0009}>C$=CHR$(9)+";"<UNK! {0009}>'tab
- 2040 <UNK! {0009}>IF (INTERRUPT < 0) OR (INTERRUPT > &H27) THEN 9800
- 2050 <UNK! {0009}>IF INTERRUPT = 0 THEN 5000
- 2060 <UNK! {0009}>ON INTERRUPT GOTO 5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,9000,9100,9200,9300,9400,9500,9600,9700
- 2070 <UNK! {0009}>GOTO 9800
- 2099 '-------------------------------------------------------------------------
- 2100 '| <UNK! {0009}><UNK! {0009}><UNK! {0009}>Determine value of AH (service code)<UNK! {0009}> |
- 2101 '-------------------------------------------------------------------------
- 2105 <UNK! {0009}>IF INSTR(AH$," ")>0 THEN AH$=LEFT$(AH$,INSTR(AH$," ")-1)
- 2110 <UNK! {0009}>IF LEN(AH$)=2 THEN AH=VAL("&H"+AH$): GOTO 2200
- 2115 <UNK! {0009}>IF INSTR(AX$," ")>0 THEN AX$=LEFT$(AX$,INSTR(AX$," ")-1)
- 2120 <UNK! {0009}>IF LEN(AX$)=4 THEN AH=VAL("&H"+LEFT$(AX$,2)): GOTO 2200
- 2130 <UNK! {0009}>AH=MAXSERV+1<UNK! {0009}><UNK! {0009}>'Default value (null strings)
- 2140 <UNK! {0009}>IF LEN(AH$)<>0 THEN X$=AH$ ELSE X$=AX$
- 2150 <UNK! {0009}>GOTO 2300
- 2200 <UNK! {0009}>X$=""<UNK! {0009}><UNK! {0009}>'Define X$ if DX or DL is loaded for this call
- 2210 <UNK! {0009}>IF AH=2 OR (AH>=4 AND AH<= 6) OR AH=9 OR AH=&HA THEN X$=D$: GOTO 2300
- 2220 <UNK! {0009}>IF ((AH>=&HE) AND (AH<=&H17)) OR AH=&H1A OR AH=&H1C THEN X$=D$:GOTO 2300
- 2230 <UNK! {0009}>IF ((AH>=&H21) AND (AH<=&H28)) THEN X$=D$: GOTO 2300
- 2240 <UNK! {0009}>IF AH=&H31 OR AH=&H33 OR AH=&H36 OR ((AH>=&H38) AND (AH<=&H3D)) THEN X$=D$
- 2250 <UNK! {0009}>IF AH=&H41 OR AH=&H43 OR AH=&H47 OR AH=&H4B THEN X$=D$: GOTO 2300
- 2260 <UNK! {0009}>IF AH=&H4B OR AH=&H56 THEN X$=D$
- 2300 '
- 2305 <UNK! {0009}>IF AH>MAXSERV+1 THEN AH=MAXSERV+1
- 2310 <UNK! {0009}>PRINT #2, A$
- 2320 <UNK! {0009}>PRINT #2,: PRINT #2,"DOSCALL ";SERVICE$(AH);X$;COMMENT$(AH)
- 2330 <UNK! {0009}>PRINT #2,: PRINT "DOSCALL ";SERVICE$(AH);X$;COMMENT$(AH)
- 2350 <UNK! {0009}>RETURN
- 4000 '-----------------------------------------------------------------------
- 4001 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}>Table of comments for each Interrupt<UNK! {0009}><UNK! {0009}> |
- 4002 '-----------------------------------------------------------------------
- 5000 <UNK! {0009}>C$=C$+"Divide by Zero": <UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 0
- 5100 <UNK! {0009}>C$=C$+"Single step":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 1
- 5200 <UNK! {0009}>C$=C$+"Non-Maskable Interrupt (NMI)":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 2
- 5300 <UNK! {0009}>C$=C$+"Break Point Instruction ('CC'x)":GOTO 10000<UNK! {0009}>'int 3
- 5400 <UNK! {0009}>C$=C$+"Overflow":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 4
- 5500 <UNK! {0009}>C$=C$+"Print Screen":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 5
- 5600 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 6
- 5700 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 7
- 5800 <UNK! {0009}>C$=C$+"Timer (18.2 per second)":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 8
- 5900 <UNK! {0009}>C$=C$+"Keyboard Interrupt":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 9
- 6000 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int A
- 6100 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int B
- 6200 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int C
- 6300 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int D
- 6400 <UNK! {0009}>C$=C$+"Diskette Interrupt":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int E
- 6500 <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int F
- 7000 <UNK! {0009}>C$=C$+"Video I/O Call":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 10
- 7100 <UNK! {0009}>C$=C$+"Equipment check":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 11
- 7200 <UNK! {0009}>C$=C$+"Memory check":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 12
- 7300 <UNK! {0009}>C$=C$+"Diskette I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 13
- 7400 <UNK! {0009}>C$=C$+"RS232 I/O Call":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 14
- 7500 <UNK! {0009}>C$=C$+"Cassette I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 15
- 7600 <UNK! {0009}>C$=C$+"Keyboard I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 16
- 7700 <UNK! {0009}>C$=C$+"Printer I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 17
- 7800 <UNK! {0009}>C$=C$+"ROM Basic Entry Code":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 18
- 7900 <UNK! {0009}>C$=C$+"Boot Strap Loader":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 19
- 8000 <UNK! {0009}>C$=C$+"Time of Day Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 1A
- 8100 <UNK! {0009}>C$=C$+"Get Control on Keyboard Break":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 1B
- 8200 <UNK! {0009}>C$=C$+"Get Control on timer interrupt": GOTO 10000<UNK! {0009}>'int 1C
- 8300 <UNK! {0009}>C$=C$+"Pointer to video initialization table": GOTO 10000 'int 1D
- 8400 <UNK! {0009}>C$=C$+"Pointer to diskette parameter table": GOTO 10000 'int 1E
- 8500 <UNK! {0009}>C$=C$+"Pointer to graphics Char. gen. table": GOTO 10000 'int 1F
- 9000 <UNK! {0009}>C$=C$+"DOS Program Terminate":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 20
- 9100 <UNK! {0009}>GOTO 2100<UNK! {0009}>'DOS Function Call<UNK! {0009}><UNK! {0009}><UNK! {0009}>'int 21
- 9200 <UNK! {0009}>C$=C$+"DOS Terminate Address":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 22
- 9300 <UNK! {0009}>C$=C$+"DOS CTRL-BRK Exit Address (^C)": GOTO 10000<UNK! {0009}>'int 23
- 9400 <UNK! {0009}>C$=C$+"DOS Fatal Error Vector":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 24
- 9500 <UNK! {0009}>C$=C$+"DOS Absolute Disk read":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 25
- 9600 <UNK! {0009}>C$=C$+"DOS Absolute Disk write":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 26
- 9700 <UNK! {0009}>C$=C$+"DOS Terminate, Fix in Storage":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 27
- 9800 <UNK! {0009}>C$=C$+"Unrecognized Interrupt":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int ?
- 9997 '-----------------------------------------------------------------------
- 9998 '|<UNK! {0009}><UNK! {0009}><UNK! {0009}>Print INT instruction with comment<UNK! {0009}><UNK! {0009}> |
- 9999 '-----------------------------------------------------------------------
- 10000 <UNK! {0009}>PRINT #2,: PRINT #2, A$;C$: PRINT #2,
- 10010 <UNK! {0009}>PRINT A$;C$
- 10020 <UNK! {0009}>RETURN
- 10030 <UNK! {0009}>'End of program UASM-INT
-